#include "menu.h"

//4、查找指定联系人信息
void findPerson(Addressbooks *abs){
	cout << "请输入您要查找的联系人" << endl;
	string name;
	cin >> name;
	
	int ret = isExist(abs, name);
	if (ret != -1){
		cout << "姓名：" << abs->personArray[ret].m_Name << "\t";
		cout << "性别：" << (abs->personArray[ret].m_Sex == 1 ? "男" : "女") << "\t";
		cout << "年龄：" << abs->personArray[ret].m_Age << "\t";
		cout << "电话：" << abs->personArray[ret].m_Phone << "\t";
		cout << "住址：" << abs->personArray[ret].m_Addr << endl;
	}else{
		cout << "查无此人" << endl;
	}

	cout << "是否继续查找(y/n):" << endl;
	string readd;
	cin >> readd;
	if(readd == "y"){
		findPerson(abs);
	}
	system("cls");
}